import dialog from '@/wxcomponents/@vant/weapp/dialog/dialog';
import toast from '@/wxcomponents/@vant/weapp/toast/toast';

// uview 部分js  https://v1.uviewui.com/js/intro.html
import md5Js from '@/common/js/md5.js';
import test from '@/common/js/test.js';
import throttle from '@/common/js/throttle.js';
import timeFormat from '@/common/js/timeFormat.js';
import trim from '@/common/js/trim.js';
import http from '@/common/request/index.js'
console.log(http)
// 挂载到uni对象上
let $ge = {
	dialog,
	toast,
	md5:md5Js.md5,	// uni.md5('xiaoge')			e9a4ae2a0426f19dd2e68b9346f3eff0
	test,			// uni.test.code('4567', 4)		true
	throttle,		// uni.throttle(this.toNext, 500)
	timeFormat,		// uni.timeFormat(1650443828267, 'yyyy-mm-dd')	2022-04-20
	trim,			// uni.trim('abc    b ', 'all')	abcb
	get: http.get,
	post: http.post,
	put: http.put,
	'delete': http.delete,
	http
}
Object.assign(uni, $ge)
const install = Vue => {
	Vue.prototype.$ge = $ge
}

export default {
	install
}
